home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 76 / DVD Actual 1 Marzo 2003.iso / Trial / TurboCAD 7.1 Pro / Data.Cab / F28573_InsertExternalSymbol.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-10  |  2.7 KB  |  101 lines

  1. // InsertExternalSymbol.cpp : Implementation of DLL Exports.
  2.  
  3.  
  4. // Note: Proxy/Stub Information
  5. //      To build a separate proxy/stub DLL, 
  6. //      run nmake -f InsertExternalSymbolps.mk in the project directory.
  7.  
  8. #include "stdafx.h"
  9. #include "resource.h"
  10. #include <initguid.h>
  11. #include "InsertExternalSymbol.h"
  12.  
  13. #include "InsertExternalSymbol_i.c"
  14. #include "ExSymbol.h"
  15.  
  16.  
  17. CComModule _Module;
  18.  
  19. COleVariant varMissing((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
  20.  
  21.  
  22. BEGIN_OBJECT_MAP(ObjectMap)
  23. OBJECT_ENTRY(CLSID_ExSymbol, CExSymbol)
  24. END_OBJECT_MAP()
  25.  
  26. class CInsertExternalSymbolApp : public CWinApp
  27. {
  28. public:
  29.  
  30. // Overrides
  31.     // ClassWizard generated virtual function overrides
  32.     //{{AFX_VIRTUAL(CInsertExternalSymbolApp)
  33.     public:
  34.     virtual BOOL InitInstance();
  35.     virtual int ExitInstance();
  36.     //}}AFX_VIRTUAL
  37.  
  38.     //{{AFX_MSG(CInsertExternalSymbolApp)
  39.         // NOTE - the ClassWizard will add and remove member functions here.
  40.         //    DO NOT EDIT what you see in these blocks of generated code !
  41.     //}}AFX_MSG
  42.     DECLARE_MESSAGE_MAP()
  43. };
  44.  
  45. BEGIN_MESSAGE_MAP(CInsertExternalSymbolApp, CWinApp)
  46.     //{{AFX_MSG_MAP(CInsertExternalSymbolApp)
  47.         // NOTE - the ClassWizard will add and remove mapping macros here.
  48.         //    DO NOT EDIT what you see in these blocks of generated code!
  49.     //}}AFX_MSG_MAP
  50. END_MESSAGE_MAP()
  51.  
  52. CInsertExternalSymbolApp theApp;
  53.  
  54. BOOL CInsertExternalSymbolApp::InitInstance()
  55. {
  56.     _Module.Init(ObjectMap, m_hInstance, &LIBID_INSERTEXTERNALSYMBOLLib);
  57.     return CWinApp::InitInstance();
  58. }
  59.  
  60. int CInsertExternalSymbolApp::ExitInstance()
  61. {
  62.     _Module.Term();
  63.     return CWinApp::ExitInstance();
  64. }
  65.  
  66. /////////////////////////////////////////////////////////////////////////////
  67. // Used to determine whether the DLL can be unloaded by OLE
  68.  
  69. STDAPI DllCanUnloadNow(void)
  70. {
  71.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  72.     return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
  73. }
  74.  
  75. /////////////////////////////////////////////////////////////////////////////
  76. // Returns a class factory to create an object of the requested type
  77.  
  78. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  79. {
  80.     return _Module.GetClassObject(rclsid, riid, ppv);
  81. }
  82.  
  83. /////////////////////////////////////////////////////////////////////////////
  84. // DllRegisterServer - Adds entries to the system registry
  85.  
  86. STDAPI DllRegisterServer(void)
  87. {
  88.     // registers object, typelib and all interfaces in typelib
  89.     return _Module.RegisterServer(TRUE);
  90. }
  91.  
  92. /////////////////////////////////////////////////////////////////////////////
  93. // DllUnregisterServer - Removes entries from the system registry
  94.  
  95. STDAPI DllUnregisterServer(void)
  96. {
  97.     return _Module.UnregisterServer(TRUE);
  98. }
  99.  
  100.  
  101.